﻿module CssTypes


type Qualifier = 
    | AttributeValue of string*string
    | AttributeExistence of string
    | ClassQualifier of string list
    | IdQualifier of string
    | PseudoQualifier of string
type TypeSelector = | UniversalTypeSelector | TypeSelector of string
type NodeSelector = NodeSelector of TypeSelector * Qualifier list

type Axis = | Descendant | Child | Sibling

type ContextSelector =
    | DescendentSelector of Selector
    | ChildSelector of Selector    
    | SiblingSelector of Selector
and Selector = | SimpleSelector of NodeSelector
               | ContextualSelector of NodeSelector*ContextSelector



(* values *)

type Term = 
    | HexColor of string
    | StringTerm of string
    | Unset
    | Inherit
    | IdentifierTerm of string
    | Measure of decimal * string
    | Number of decimal
    | Function of string * Term list
    | Url of string
    | Slash of Term * Term
    | TermList of Term list

type Import = Import of string
type Declaration = Declaration of string * Term list * bool
type Rule = Rule of Selector list * Declaration list
type Statement =
    | Ruleset of Rule
    | AtRule of string  
type Statements = Statements of Import list * Statement list